plugins {
	id 'org.springframework.boot' version '2.7.1'
	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
	id 'java'
	id 'antlr'
}

group = 'pro.ganyushkin.mimir.plant_name_parser'

def VERSION_FILE = 'build.version'
def DEFAULT_VERSION = "x.x.x"
def versionFile = new File(VERSION_FILE)
version = versionFile.exists() ? versionFile.getText('UTF-8').replaceAll('\\s+$', '') : DEFAULT_VERSION

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

dependencies {
	implementation "org.springframework.boot:spring-boot-starter-actuator"

	implementation 'org.springframework.boot:spring-boot-starter'
	implementation 'org.springframework.boot:spring-boot-starter-web'
	implementation 'org.springdoc:springdoc-openapi-ui:1.6.4'

	compileOnly 'org.projectlombok:lombok'
	annotationProcessor 'org.projectlombok:lombok'
	implementation 'org.apache.commons:commons-collections4:4.4'

	implementation group: 'org.antlr', name: 'antlr4-runtime', version: '4.9.3'
	antlr "org.antlr:antlr4:4.9.3"

	testCompileOnly 'org.projectlombok:lombok'
	testAnnotationProcessor 'org.projectlombok:lombok'
	testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
	useJUnitPlatform()
}

springBoot {
	buildInfo {
		properties {
			additional = [
				buildTime : new Date().format("yyyy-MM-dd'T'HH:mm:ss z")
			]
		}
	}
}
